﻿using System;
using System.Collections.Generic;
using System.Web.Mvc;
using Isha.Entities;
using Isha.Infrastructure;
using Isha.Services;
using Microsoft.Practices.Unity;

namespace Isha.Web.Mvc
{
    public abstract class IshaPluggableController : Controller
    {                                   
        public IshaPluggableController()
        {
           
        }                

        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            IshaModel model = IshaContext.Current.Model;        
            model.Add("Navigation", IshaContext.Current.Navigation);            
            base.OnActionExecuting(filterContext);
        }

        protected override void HandleUnknownAction(string actionName)
        {
            //TODO: 404 Handle
            //this.ContentItem = IshaContext.Current.ServiceContext.ContentItemService.Get404();
            //this.Response.StatusCode = 404;
            //this.RedirectToAction("Index", "Page").ExecuteResult(this.ControllerContext);
        }
    }
}
